package taweb.flex.air.fexBrowser.display3d{
	import alternativa.engine3d.materials.TextureMaterial;
	import alternativa.engine3d.primitives.Box;
	import alternativa.types.Texture;
	import flash.display.BlendMode;
	
	
	public class Environment extends TextureLoaderEnv{
		
		[Embed(source='Env/environmentfront.png')] private static const bmpFront:Class;
		[Embed(source="Env/environmentback.png")] private static const bmpBack:Class;
		[Embed(source="Env/environmentleft.png")] private static const bmpLeft:Class;
		[Embed(source="Env/environmentright.png")] private static const bmpRight:Class;
		[Embed(source="Env/environmenttop.png")] private static const bmpTop:Class;
		[Embed(source="Env/environmentbottom.png")] private static const bmpBot:Class;
		private static const front:Texture = new Texture(new bmpFront().bitmapData);
		private static const back:Texture = new Texture(new bmpBack().bitmapData);
		private static const left:Texture = new Texture(new bmpLeft().bitmapData);
		private static const right:Texture = new Texture(new bmpRight().bitmapData);
		private static const top:Texture = new Texture(new bmpTop().bitmapData);
		private static const bottom:Texture = new Texture(new bmpBot().bitmapData);
		
		
				
		public var frontMaterial:TextureMaterial;
		public var backMaterial:TextureMaterial;
		public var leftMaterial:TextureMaterial;
		public var rightMaterial:TextureMaterial;
		public var topMaterial:TextureMaterial;
		public var bopMaterial:TextureMaterial;
		
		
		public function Environment() {
			super("Environment");

			clonePropertiesFrom(new Box(50000, 50000, 50000, 1, 1, 1, true));
			
				frontMaterial = new TextureMaterial(front, 1, false, true, BlendMode.NORMAL, -1, 0xFFFFFF);
				setMaterialToSurface(frontMaterial, "front");
				backMaterial = new TextureMaterial(back, 1, false, true, BlendMode.NORMAL, -1, 0xFFFFFF);
				setMaterialToSurface(backMaterial, "back");
				leftMaterial = new TextureMaterial(left, 1, false, true, BlendMode.NORMAL, -1, 0xFFFFFF);
				setMaterialToSurface(leftMaterial, "left");
				rightMaterial = new TextureMaterial(right, 1, false, true, BlendMode.NORMAL, -1, 0xFFFFFF);
				setMaterialToSurface(rightMaterial, "right");
				topMaterial = new TextureMaterial(top, 1, false, true, BlendMode.NORMAL, -1, 0xFFFFFF);
				setMaterialToSurface(topMaterial, "top");
				bopMaterial = new TextureMaterial(bottom, 1, false, true, BlendMode.NORMAL, -1, 0xFFFFFF);
				setMaterialToSurface(bopMaterial, "bottom");
			
			
		}
	}
}